﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using DataForest.Utilities;

namespace DataForest.ViewModel
{
    public class BaseViewModel : INotifyPropertyChanged
    {

        public event EventHandler RequestMessageDialog;
        public event EventHandler RequestOpenFileDialog;
        public event EventHandler RequestSaveFileDialog;
        
        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                var e = new PropertyChangedEventArgs(propertyName);
                handler(this, e);
            }
        }
        
        protected void OnRequestOpenFileDialog(RequestOpenFileDialogArgs args, EventHandler handler) {
            RequestOpenFileDialog(this, args);
        }
        

    }
}
